******************************
* Table 5: ITT effects of the DFS treatment on cognition, test scores, and child attendance
* wave uis labeled as "Post"
************************
clear all
set trace off
set more off
use Jehanabad_analytic_sample_cognition
label variable hemoglobin "child hemoglobin level"

global socio_cov_4_vari no_HHmembers years_schooling_father years_schooling_mother asset_index

global school_cov_4_vari total_enrollment class_size student_teacher_ratio
g post=wave
label var post "Post"  /* Post denotes endline survey */
g treat_post=treat*post
label var treat_post "Treat*post"

xtset child_unique wave
xtreg block_design_norm treat_post treat post $socio_cov_4_vari $school_cov_4_vari, fe vce(cluster school_id)
outreg2 using table5.doc, word replace ctitle(Block, design,) dec(3) keep(treat_post post) nocons nor2 ///
title(Table 5: ITT effects of the DFS treatment on cognition, test scores, and child attendance) nonotes

xtreg digit_span_forward_norm treat_post treat post $socio_cov_4_vari $school_cov_4_vari, fe vce(cluster school_id)
outreg2 using table5.doc, word append ctitle(Digit, span, forward) dec(3) keep(treat_post post) nocons nor2

xtreg digit_span_backward_norm treat_post treat post $socio_cov_4_vari $school_cov_4_vari, fe vce(cluster school_id)
outreg2 using table5.doc, word append ctitle(Digit, span, backward) dec(3) keep(treat_post post) nocons nor2

xtreg progressive_matrices_norm treat_post treat post $socio_cov_4_vari $school_cov_4_vari, fe vce(cluster school_id)
outreg2 using table5.doc, word append ctitle(Progressive, matrices, ) dec(3) keep(treat_post post) nocons nor2

xtreg day_and_night_norm treat_post treat post $socio_cov_4_vari $school_cov_4_vari, fe vce(cluster school_id)
outreg2 using table5.doc, word append ctitle(Day and, night,) dec(3) keep(treat_post post) nocons nor2

xtreg Cognition_Score_pca treat_post treat post $socio_cov_4_vari $school_cov_4_vari, fe vce(cluster school_id)
outreg2 using table5.doc, word append ctitle(Cognitive, index,) dec(3) keep(treat_post post) nocons nor2

xtreg math_norm treat_post treat post $socio_cov_4_vari $school_cov_4_vari, fe vce(cluster school_id)
outreg2 using table5.doc, word append ctitle(Math, test score, ) dec(3) keep(treat_post post) nocons nor2

xtreg reading_norm  treat_post treat post $socio_cov_4_vari $school_cov_4_vari, fe vce(cluster school_id)
outreg2 using table5.doc, word append ctitle(Reading, test score,) dec(3) keep(treat_post post) nocons nor2

xtreg total_attendance_2 treat_post treat post $socio_cov_4_vari $school_cov_4_vari, fe vce(cluster school_id)
outreg2 using table5.doc, word append ctitle(Attendance,,) dec(3) keep(treat_post post) nocons nor2



*** The below command will generate the mean of the dependent variable in Table 5 *
su block_design_norm digit_span_forward_norm digit_span_backward_norm progressive_matrices_norm day_and_night_norm ///
 Cognition_Score_pca math_norm reading_norm total_attendance_2 if wave==0


********************************************End of do file *******************

  

